<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org"
      layout:decorator="layout/m_master">

<div layout:fragment="content">
    <div class="page-group">
        <div class="page page_manage_setup">
            <div th:replace="layout/m_layout::title('设置')"></div>
            <div class="page-content">
                <nav class="handle-list">
                    <a class="list-item enter external" href="/m/center/setup/userpassword">
                        <div class="item-title">
                            登录密码
                        </div>
                        <div class="item-info">
                        </div>
                    </a>
                    <a class="list-item enter external" href="/m/center/setup/usermobile">
                        <div class="item-title">
                            绑定手机
                        </div>
                        <div class="item-info" th:text="${userModel.mobile}">
                        </div>
                    </a>
                </nav>
                <nav class="handle-list">
                    <a class="list-item enter external" href="/m/center/setup/blacklist">
                        <div class="item-title">
                            黑名单
                        </div>
                    </a>
                </nav>


                <nav class="handle-list">
                    <div class="list-item  external">
                        <div class="item-title">
                            接收通知<font style="font-size: .6rem; color: #AAA;">（短信/微信）</font>
                        </div>
                        <div class="item-info">
                            <label class="bcui-switch switch-lg">
                                <input type="checkbox" th:value="${userModel.notice}" name="notice" th:checked="${userModel.notice eq 1 ?true:false}"
                                       style="outline: none;">
                                <span></span>
                            </label>
                        </div>
                    </div>
                    <div class="list-item  external">
                        <div class="item-title">
                            关闭资料<font style="font-size: .6rem; color: #AAA;">（关闭后无法交友）</font>
                        </div>
                        <div class="item-info">
                            <label class="bcui-switch switch-lg">
                                <input type="checkbox" th:value="${bcSingles.isClose}" name="close" th:checked="${bcSingles.isClose eq 1 ?true:false}"
                                       style="outline: none;">
                                <span></span>
                            </label>
                        </div>
                    </div>
                </nav>
                <nav class="handle-list">
                    <a class="list-item enter " href="/common/about/help">
                        <div class="item-title">
                            帮助中心
                        </div>
                    </a>
                    <a class="list-item enter external" href="/m/feedback">
                        <div class="item-title">
                            意见反馈
                        </div>
                    </a>

                    <a class="list-item enter " href="/common/about/agreement">
                        <div class="item-title">
                            注册协议
                        </div>
                    </a>
                </nav>
                <nav class="handle-list">
                    <div style="padding: 0 1rem;">
                        <a class="btn btn-block external" href="/m/logout">
                            退出登录
                        </a>
                    </div>
                </nav>
                <div style="height: 60px"></div>

            </div>

        </div>
    </div>
    <div th:replace="layout/m_layout::systemJs"></div>
    <script type="text/javascript">
        var _page = $('.page');
        // 开启/关闭相亲
        $(_page).on('change', '[name=close]', function () {
            var close = $(this).is(':checked') ? 1 : 0;
            updata_single_fun({
                close: close
            });
        });
        // 开启/关闭通知
        $(_page).on('change', '[name=notice]', function () {
            var notice = $(this).is(':checked') ? 1 : 0;
            bottlecms.put("/m/ajax/center/setup/notice", {notice: notice}, function (data) {
                if (data.success == true) {

                } else {
                    bottlecms.toast(data.msg);
                }
            });
        });

        // 结束微信绑定
        $(_page).on('click', '[release-bind]', function () {
            var type = $(this).attr('release-bind');
            bottlecms.confirm("确定要解除绑定吗？", function () {
                oauth_release_fun(type, function () {
                    location.reload();
                });
            });
        });

    </script>

</div>
</html>
